@layout("/common/_container.html",{bg:"bg-white",js:["/assets/modular/system/drug/drug_add.js"]}){
<form id="drugForm" lay-filter="drugForm" class="layui-form model-form">
    <div class="layui-form-item">
        <label class="layui-form-label">商品分类<span style="color: red;">*</span></label>
        <div class="layui-input-block">
            <input id="typesId" name="typesId" type="hidden">
            <input id="typesName" name="typesName" placeholder="请选择商品分类" type="text" class="layui-input" lay-verify="required" required autocomplete="off"/>
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">商品名称<span style="color: red;">*</span></label>
        <div class="layui-input-block">
            <input name="name" placeholder="请输入商品名称" type="text" class="layui-input" lay-verify="required" required/>
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">商品品牌<span style="color: red;">*</span></label>
        <div class="layui-input-block">
            <select name="brandId" lay-search="" lay-filter="brandId">
                <option value="">直接选择或搜索选择</option>
                @for(p in brandList){
                <option name="brandId" value="${p.brandId}">${p.name}</option>
                @}
            </select>
            <input id="brandName" name="brandName" type="hidden"/>
        </div>
    </div>


    <div class="layui-form-item">
        <label class="layui-form-label">商品货号<span style="color: red;">*</span></label>
        <div class="layui-input-block">
            <input name="no" type="text" class="layui-input" lay-verify="required" required/>
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">商品售价<span style="color: red;">*</span></label>
        <div class="layui-input-block">
            <input name="price" type="text" class="layui-input" lay-verify="required" required/>
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">商品库存<span style="color: red;">*</span></label>
        <div class="layui-input-block">
            <input name="store" type="text" class="layui-input" lay-verify="required" required/>
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">商品关键字<span style="color: red;">*</span></label>
        <div class="layui-input-block">
            <input name="keyword" type="text" class="layui-input" lay-verify="required" required/>
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">排序<span style="color: red;">*</span></label>
        <div class="layui-input-block">
            <input name="sort" type="text" class="layui-input" lay-verify="required" required/>
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">商品介绍<span style="color: red;">*</span></label>
        <div class="layui-input-block">
            <textarea placeholder="请输入介绍内容" class="layui-textarea" name="detail" id="detail" lay-verify="required" required></textarea>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">商品图片</label>
        <div class="layui-input-block">
            <button type="button" class="layui-btn" id="socialImage">
                <i class="layui-icon">&#xe67c;</i>上传图片
            </button>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">上传预览</label>
        <!-- 隐藏的input,一个隐藏的input（用于保存文件url） -->
        <input type="hidden" id="img_url" name="imgUrl" value=""/>
        <!-- 预览区域 -->
        <div class="layui-upload-list">
            <img class="layui-upload-img" width="200px" height="80px" id="preShow"/>
            <p id="demoText"></p>
        </div>
    </div>
    <div class="layui-form-item text-right">
        <button class="layui-btn layui-btn-primary" type="button" ew-event="closeDialog">取消</button>
        <button class="layui-btn" lay-filter="btnSubmit" lay-submit>保存</button>
    </div>
</form>
@}
